<!DOCTYPE html>
<!--
  Copyright 2016 Google Inc.

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.
-->
<html>
  <head>
    <meta charset="utf-8">
    <title>Radio Button - Material Components Demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" href="/images/logo_components_color_2x_web_48dp.png">
    <link rel="stylesheet" href="/assets/radio.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <script src="/ready.js"></script>
    <style>
      .example {
        margin: 24px;
        padding: 24px;
      }
    </style>
  </head>
  <body class="mdc-typography">
    <header class="mdc-toolbar mdc-toolbar--fixed">
      <div class="mdc-toolbar__row">
        <section class="mdc-toolbar__section mdc-toolbar__section--align-start">
          <a href="/" class="catalog-back mdc-toolbar__menu-icon"><i class="material-icons">&#xE5C4;</i></a>
          <span class="mdc-toolbar__title catalog-title">Radio</span>
        </section>
      </div>
    </header>
    <main>
      <div class="mdc-toolbar-fixed-adjust"></div>
      <section class="hero">

        <div class="mdc-radio">
          <input class="mdc-radio__native-control" type="radio" checked name="hero">
          <div class="mdc-radio__background">
            <div class="mdc-radio__outer-circle"></div>
            <div class="mdc-radio__inner-circle"></div>
          </div>
        </div>

        <div class="mdc-radio">
          <input class="mdc-radio__native-control" type="radio" checked name="hero">
          <div class="mdc-radio__background">
            <div class="mdc-radio__outer-circle"></div>
            <div class="mdc-radio__inner-circle"></div>
          </div>
        </div>

      </section>


      <section class="example">
        <h2>With JavaScript</h2>
        <div class="demo-radio-row">
          <div class="mdc-form-field">
            <div class="mdc-radio">
              <input class="mdc-radio__native-control" type="radio" id="ex0-default-radio1" checked name="ex0-default">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex0-default-radio1-label" for="ex0-default-radio1">Default Radio 1</label>
          </div>
          <div class="mdc-form-field">
            <div class="mdc-radio">
              <input class="mdc-radio__native-control" type="radio" id="ex0-default-radio2" name="ex0-default">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex0-default-radio2-label" for="ex0-default-radio2">Default Radio 2</label>
          </div>
        </div>
        <div class="demo-radio-row">
          <div class="mdc-form-field">
            <div class="mdc-radio demo-radio--custom">
              <input class="mdc-radio__native-control" type="radio" id="ex0-custom-radio1" checked name="ex0-custom">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex0-custom-radio1-label" for="ex0-custom-radio1">Custom Radio 1</label>
          </div>
          <div class="mdc-form-field">
            <div class="mdc-radio demo-radio--custom">
              <input class="mdc-radio__native-control" type="radio" id="ex0-custom-radio2" name="ex0-custom">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex0-custom-radio2-label" for="ex0-custom-radio2">Custom Radio 2</label>
          </div>
        </div>
      </section>

      <section class="example">
        <h2>CSS Only</h2>
        <div class="demo-radio-row">
          <div class="mdc-form-field">
            <div class="mdc-radio" data-demo-no-js>
              <input class="mdc-radio__native-control" type="radio" id="ex1-default-radio1" checked name="ex1-default">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex1-default-radio1-label" for="ex1-default-radio1">Default Radio 1</label>
          </div>
          <div class="mdc-form-field">
            <div class="mdc-radio" data-demo-no-js>
              <input class="mdc-radio__native-control" type="radio" id="ex1-default-radio2" name="ex1-default">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex1-default-radio2-label" for="ex1-default-radio2">Default Radio 2</label>
          </div>
        </div>
        <div class="demo-radio-row">
          <div class="mdc-form-field">
            <div class="mdc-radio demo-radio--custom" data-demo-no-js>
              <input class="mdc-radio__native-control" type="radio" id="ex1-custom-radio1" checked name="ex1-custom">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex1-custom-radio1-label" for="ex1-custom-radio1">Custom Radio 1</label>
          </div>
          <div class="mdc-form-field">
            <div class="mdc-radio demo-radio--custom" data-demo-no-js>
              <input class="mdc-radio__native-control" type="radio" id="ex1-custom-radio2" name="ex1-custom">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex1-custom-radio2-label" for="ex1-custom-radio2">Custom Radio 2</label>
          </div>
        </div>
      </section>

      <section class="example">
        <h2>Disabled</h2>

        <div>
          <div class="mdc-form-field">
            <div class="mdc-radio mdc-radio--disabled">
              <input class="mdc-radio__native-control" type="radio" id="ex4a-radio1" checked disabled name="ex4a">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex4a-radio1-label" for="ex4a-radio1">Disabled Radio 1</label>
          </div>
          <div class="mdc-form-field">
            <div class="mdc-radio mdc-radio--disabled">
              <input class="mdc-radio__native-control" type="radio" id="ex4a-radio2" disabled name="ex4a">
              <div class="mdc-radio__background">
                <div class="mdc-radio__outer-circle"></div>
                <div class="mdc-radio__inner-circle"></div>
              </div>
            </div>
            <label id="ex4a-radio2-label" for="ex4a-radio2">Disabled Radio 2</label>
          </div>
        </div>
      </section>
    </main>
    <script src="/assets/material-components-web.js" async></script>
    <script>
      demoReady(function() {
        var formFields = document.querySelectorAll('.mdc-form-field');
        for (var i = 0, formField; formField = formFields[i]; i++) {
          var formFieldInstance = new mdc.formField.MDCFormField(formField);
          var radio = formField.querySelector('.mdc-radio:not([data-demo-no-js])');
          if (radio) {
            var radioInstance = new mdc.radio.MDCRadio(radio);
            formFieldInstance.input = radioInstance;
          }
        }
      });
    </script>
  </body>
</html>
